package com.fruit.controller.wap.logistics;

import com.fruit.pojo.logistics.LogisticsType;
import com.fruit.service.logistics.LogisticsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 路由通知API，各大路由通知的API
 *
 * @author joe
 * @version 2018.02.06 19:22
 */
@Slf4j
@Controller
@RequestMapping(value = "/wap/logistics/notify/")
public class NotifyController {

    @Autowired
    private LogisticsService logisticsService;

    @RequestMapping(value = "sf")
    public String sfNotify(String xml) {
        log.debug("顺丰的路由通知为：{}", xml);
        logisticsService.routeNotify(xml, LogisticsType.SF);
        return "<Response service=”RoutePushService”>\n" +
                "<Head>OK</Head>\n" +
                "</Response>";
    }
}
